package ${groupId}.controller.system.bossuser;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import ${groupId}.service.system.user.BossUserService;
import ${groupId}.service.system.user.dto.BossUserChangePasswdReqDto;
import com.system.core.controller.ControllerBase;
import com.system.core.results.ResultBase;

import io.swagger.v3.oas.annotations.Hidden;

@Controller
@RequestMapping("boss/password")
@Hidden
public class PasswdController extends ControllerBase{

	@Autowired
	private BossUserService bossUserService;
	
	@RequestMapping(value = "change_passwd_topage",method = RequestMethod.GET)
	public String changePasswdToPage() {
		return "/system/bossUser/bossUser-change-passwd";
	}
	
	@RequestMapping(value = "change_passwd",method = RequestMethod.POST)
	@ResponseBody
	public ResultBase changePassword(@Validated BossUserChangePasswdReqDto bossUserChangePasswdReqDto) {
		return bossUserService.changePasswd(bossUserChangePasswdReqDto);
	}
}
